#pragma once

#include <memory>
#include <vector>

using Data = std::variant<int32_t, int64_t, float, double, std::string,
                          std::shared_ptr<std::vector<size_t>>, std::monostate>;
using Table = std::vector<std::vector<Data>>;

extern "C++" std::shared_ptr<std::vector<size_t>> add_vectors_impl(
    const std::vector<std::shared_ptr<std::vector<size_t>>>& vectors);

// NOLINTBEGIN
std::shared_ptr<std::vector<size_t>> add_vectors_by_gpu(
    std::shared_ptr<Table> t, size_t col_id) {
  std::vector<std::shared_ptr<std::vector<size_t>>> vectors;
  for (const auto& record : *t) {
    vectors.emplace_back(
        std::get<std::shared_ptr<std::vector<size_t>>>(record[col_id]));
  }
  return add_vectors_impl(vectors);
}
// NOLINTEND
